package com.itheima.controller;


import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.entity.Result;
import com.itheima.pojo.Setmeal;
import com.itheima.service.SetmealService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/setmeal")
public class SetmealController {

    @Reference
    SetmealService setmealService;

@RequestMapping("/getSetmeal")
    public Result getSetmeal(){
        List<Setmeal> setmealList=setmealService.getSetmeal();
        return  Result.success("",setmealList);
    }

    @RequestMapping("/findById")
    public Result findById(Integer id){
     Setmeal  setmeal=setmealService.findById(id);
    return Result.success("",setmeal);
    }
}
